package com.yaodian100.ec.generatepage.web;

import com.yaodian100.ec.common.web.AbstractAction;
import com.yaodian100.ec.generate.entity.GenerateAdvertise;

public class AbstractAdvAction extends AbstractAction {

	private static final long serialVersionUID = 1L;
	private static final String LINE_SEPARATOR = "\n";

	static final String LIST_IDX_ADV = "listIdxAdv";
	static final String RESULT_VIEW = "view";
	protected final String[] baseEntityPropertiesNames = { "createUser", "createDate", "modifyUser", "modifyDate" };

	private boolean creatingNew;
	private GenerateAdvertise adv;
	private Long advId;
	private String from;

	/**
	 * 在傳入的 StringBuffer append 上一行 property，最後再 append 一個斷行符號
	 * 
	 * @param contentBuffer
	 * @param propertyName
	 * @param value 如果傳入 null，還是會加上一行 property，會在等號後留空字串
	 */
	void appendPropertyAndLineBreakToContentBuffer(StringBuffer contentBuffer, String propertyName, String value) {
		if (value == null) {
			value = "";
		}
		contentBuffer.append(propertyName);
		contentBuffer.append("=");
		contentBuffer.append(value);
		contentBuffer.append(LINE_SEPARATOR);
	}

	public GenerateAdvertise getAdv() {
		return this.adv;
	}

	public void setAdv(GenerateAdvertise advertise) {
		this.adv = advertise;
	}

	public boolean isCreatingNew() {
		return this.creatingNew;
	}

	public void setCreatingNew(boolean creatingNew) {
		this.creatingNew = creatingNew;
	}

	public Long getAdvId() {
		return this.advId;
	}

	public void setAdvId(Long advId) {
		this.advId = advId;
	}

	public String getFrom() {
		return from;
	}

	public void setFrom(String from) {
		this.from = from;
	}

}
